﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - 我的 ASP.NET 应用程序</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    
    <script src="http://lhl.client.com/Scripts/jquery-1.10.2.js"></script>
    <script src="http://lhl.client.com/Scripts/jquery.cookie.js"></script>
   
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("应用程序名称", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li>@Html.ActionLink("主页", "Index", "Home")</li>
                <li>@Html.ActionLink("关于", "About", "Home")</li>
                <li>@Html.ActionLink("联系方式", "Contact", "Home")</li>
                <li>@Html.ActionLink("client后台请求webApi", "GetJsonByService", "Home")</li>
                <li>
                        
                    <a id="aId" onclick="funcc()"  >client前端Ajax</a>
                </li>
            </ul>
            @Html.Partial("_LoginPartial")
        </div>
    </div>
</div>
<div class="container body-content">
    @RenderBody()
    <hr />
    <footer>
        <p>&copy; @DateTime.Now.Year - 我的 ASP.NET 应用程序</p>
    </footer>
</div>

@*@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)*@
 
    <script src="http://lhl.client.com/Scripts/oauth-bearer.js"></script>

    <script type="text/javascript">
        function funcc() {
            var token = $.cookie('oauth-bearer-token');
            token = token ? token : '';

            $.ajax({
                type: "GET",
                url: "http://lhl.source.com/api/Values",
                beforeSend: function (request) {
                    request.setRequestHeader('Authorization', 'Bearer ' + token);
                },
                dataType: "json",
                success: function (data) {
                    console.log(data);
                }
            });
        }

                                   
                             
    </script>


</body>

</html>
